Skip to content

Clarify random effects and averaging in the mixed-model vignette - #738

Open
M-Colley wants to merge 3 commits into
easystats:mainfrom
M-Colley:issue-579-mixed-model-predictions
Open

M-Colley wants to merge 3 commits into
easystats:mainfrom
M-Colley:issue-579-mixed-model-predictions

Conversation

@M-Colley

@M-Colley M-Colley commented Dec 4, 2026

Copy link
Copy Markdown

Summary

Separate two choices in the mixed-model vignette: which random effects enter each prediction and which prediction rows are averaged. Explain how re.form / re_formula and estimate control those choices, why averaging can narrow posterior intervals, and how to predict for a new group.

Fixes #579.

Evidence

  • Rendered the full vignette with evaluated examples under options(warn = 2).
  • Matched Poisson GLMM predictions and their means to direct predict() calls for both random-effect settings and for the three averaging modes.
  • Matched Bayesian means and interval limits to independently averaged brms posterior draws. All 31 existing mixed-model assertions passed.
  • The package check passed with tests, manual, and vignettes run separately or omitted. The vignette render had the same Pandoc deprecation message as the base.

OpenAI Codex assisted with the edit and verification.

@strengejacke

strengejacke commented Dec 5, 2026 •

Copy link
Copy Markdown
Member

Thanks a lot! I committed a suggestion, which integrates (or keeps) a few parts from the old vignettes, and the Bayesian part is moved to the bottom, not removed. WDTY? I commited this as additional file, mixed_models2.Rmd for now. I attached both versions (your and my revised) as PDF to this post.

Mixed effects models_new2.pdf
Mixed effects models_new.pdf

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

re_formula = NA or NULL: some inconsistency between modelbased and brms

2 participants